package cn.core.coding.service.impl;

import cn.core.coding.vo.DbTableColInfoVO;
import cn.core.coding.vo.DbTableConfAndInfoVO;
import cn.core.tool.exception.CoreException;
import cn.core.tool.util.CoreTool;

import java.io.File;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;

/**
 * 代码生成配置
 */
public final class CoreCodingConf {

  /**
   * src
   */
  public static final String src = "src";

  /**
   * main
   */
  public static final String main = "main";

  /**
   * java
   */
  public static final String java = "java";

  /**
   * resources
   */
  public static final String resources = "resources";

  /**
   * entity
   */
  public static final String entity = "eo";

  /**
   * mapper
   */
  public static final String mapper = "mapper";

  /**
   * param
   */
  public static final String param = "ao";

  /**
   * bo
   */
  public static final String bo = "bo";

  /**
   * qo
   */
  public static final String qo = "qo";

  /**
   * rest
   */
  public static final String rest = "rest";

  /**
   * service
   */
  public static final String service = "service";

  /**
   * vo
   */
  public static final String vo = "vo";

  /**
   * mapping
   */
  public static final String mapping = "mapping";

  /**
   * interfaces
   */
  public static final String interfaces = "intf";

  /**
   * implement
   */
  public static final String implement = "impl";

  /**
   * QO
   */
  public static final String QO = "QO";

  /**
   * VO
   */
  public static final String VO = "VO";

  /**
   * I
   */
  public static final String I = "I";

  /**
   * Mapper
   */
  public static final String Mapper = "Mapper";

  /**
   * Service
   */
  public static final String Service = "Service";

  /**
   * ServiceImpl
   */
  public static final String ServiceImpl = "ServiceImpl";

  /**
   * Controller
   */
  public static final String Controller = "Controller";

  /**
   * views
   */
  public static final String views = "views";

  /**
   * api
   */
  public static final String api = "api";

  /**
   * store
   */
  public static final String store = "store";

  /**
   * Store
   */
  public static final String Store = "Store";

  /**
   * model
   */
  public static final String model = "model";

  /**
   * modules
   */
  public static final String modules = "modules";

  /**
   * 包名分割符
   */
  public static final String packageSplit = ".";

  /**
   * java文件后缀名
   */
  public static final String javaFileSuffix = ".java";

  /**
   * js文件后缀名
   */
  public static final String jsFileSuffix = ".js";

  /**
   * ts文件后缀名
   */
  public static final String tsFileSuffix = ".ts";

  /**
   * vue文件后缀名
   */
  public static final String vueFileSuffix = ".vue";

  /**
   * xml文件后缀名
   */
  public static final String xmlFileSuffix = ".xml";

  /**
   * pom xml文件名
   */
  public static final String pomxml = "pom.xml";

  /**
   * git排除文件名
   */
  public static final String gitignore = ".gitignore";

  /**
   * README文件名
   */
  public static final String readme = "README.md";

  /**
   * README文件内容
   */
  public static final String readmeContent = "";

  /**
   * 重新生成代码替换标识
   */
  public static final String againGenerateKey = "/*==============================================================*/";

  /**
   * 重新生成xml代码替换标识
   */
  public static final String againGenerateXmlKey = "<!--*=========================================================*-->";

  /**
   * 包名统一配置
   */
  public static final LinkedHashSet<String> packageNameSet = new LinkedHashSet<>();

  /**
   * 代码文件路径统一配置
   */
  public static final LinkedHashSet<String> codeFilePathNameSet = new LinkedHashSet<>();

  /**
   * 资源文件路径统一配置
   */
  public static final LinkedHashSet<String> resourcesFilePathNameSet = new LinkedHashSet<>();

  static {
    packageNameSet.add("cn");
    packageNameSet.add("core");

    codeFilePathNameSet.add(src);
    codeFilePathNameSet.add(main);
    codeFilePathNameSet.add(java);

    resourcesFilePathNameSet.add(src);
    resourcesFilePathNameSet.add(main);
    resourcesFilePathNameSet.add(resources);
  }

  /**
   * 获取sql >>> sqlSave
   */
  public static String getSqlSave(DbTableConfAndInfoVO dbTableConfAndInfoVO) throws Exception {
    if (CoreTool.isNullEo(dbTableConfAndInfoVO)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder sql = new StringBuilder("INSERT INTO ").append(dbTableConfAndInfoVO.getDbTableInfoVO().getDbTableName()).append(" ( ");
    boolean isFirst = true;
    for (DbTableColInfoVO dbTableColInfoVO : dbTableConfAndInfoVO.getDbTableColInfoVOSet()) {
      if (isFirst) {
        isFirst = false;
      } else {
        sql.append(", ");
      }
      sql.append(dbTableColInfoVO.getColName());
    }
    sql.append(" )");
    return sql.toString();
  }

  /**
   * 获取sql >>> sqlSaveValues
   */
  public static String getSqlSaveValues(DbTableConfAndInfoVO dbTableConfAndInfoVO) throws Exception {
    if (CoreTool.isNullEo(dbTableConfAndInfoVO)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder sql = new StringBuilder();
    boolean isFirst = true;
    for (DbTableColInfoVO dbTableColInfoVO : dbTableConfAndInfoVO.getDbTableColInfoVOSet()) {
      if (isFirst) {
        isFirst = false;
      } else {
        sql.append(", ");
      }
      sql.append("#{eo.").append(dbTableColInfoVO.getInitialLowercaseColumnName()).append("}");
    }
    return sql.toString();
  }

  /**
   * 获取sql >>> sqlUpdate
   */
  public static String getSqlUpdate(DbTableConfAndInfoVO dbTableConfAndInfoVO) throws Exception {
    if (CoreTool.isNullEo(dbTableConfAndInfoVO)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder sql = new StringBuilder("UPDATE ").append(dbTableConfAndInfoVO.getDbTableInfoVO().getDbTableName()).append(" SET ");
    boolean isFirst = true;
    for (DbTableColInfoVO dbTableColInfoVO : dbTableConfAndInfoVO.getDbTableColInfoVOSet()) {
      if (isFirst) {
        isFirst = false;
      } else {
        sql.append(", ");
      }
      sql.append(dbTableColInfoVO.getColName()).append(" = #{eo.").append(dbTableColInfoVO.getInitialLowercaseColumnName()).append("}");
    }
    sql.append(" WHERE ").append(dbTableConfAndInfoVO.getDbTablePkInfoVO().getColName()).append(" = #{eo.").append(dbTableConfAndInfoVO.getDbTablePkInfoVO().getInitialLowercaseColumnName()).append("}");;
    return sql.toString();
  }

  /**
   * 获取sql >>> sqlKeySearch
   */
  public static String getSqlKeySearch(DbTableConfAndInfoVO dbTableConfAndInfoVO) throws Exception {
    if (CoreTool.isNullEo(dbTableConfAndInfoVO)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder sql = new StringBuilder();
    boolean isFirst = true;
    for (DbTableColInfoVO dbTableColInfoVO : dbTableConfAndInfoVO.getDbTableColInfoVOSet()) {
      if (dbTableConfAndInfoVO.getDbTablePkInfoVO().getColName().equals(dbTableColInfoVO.getColName())) {
        continue;
      }
      if ("String".equals(dbTableColInfoVO.getJavaDataType())) {
        if (isFirst) {
          isFirst = false;
        } else {
          sql.append(" OR ");
        }
        sql.append("t.").append(dbTableColInfoVO.getColName()).append(" LIKE #{qo.keySearch}");
      }
    }
    return sql.toString();
  }

  /**
   * 获取sql >>> sqlKeySearchVo
   */
  public static String getSqlKeySearchVo(DbTableConfAndInfoVO dbTableConfAndInfoVO) throws Exception {
    if (CoreTool.isNullEo(dbTableConfAndInfoVO)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder sql = new StringBuilder();
    boolean isFirst = true;
    for (DbTableColInfoVO dbTableColInfoVO : dbTableConfAndInfoVO.getDbTableColInfoVOSet()) {
      if (dbTableConfAndInfoVO.getDbTablePkInfoVO().getColName().equals(dbTableColInfoVO.getColName())) {
        continue;
      }
      if ("String".equals(dbTableColInfoVO.getJavaDataType())) {
        if (isFirst) {
          isFirst = false;
        } else {
          sql.append(" OR ");
        }
        sql.append("t.").append(dbTableColInfoVO.getColName()).append(" LIKE #{qo.keySearchVo}");
      }
    }
    return sql.toString();
  }

  /**
   * 获取sql >>> sqlEo
   */
  public static String getSqlEo(DbTableConfAndInfoVO dbTableConfAndInfoVO) throws Exception {
    if (CoreTool.isNullEo(dbTableConfAndInfoVO)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder sql = new StringBuilder("SELECT ");
    boolean isFirst = true;
    for (DbTableColInfoVO dbTableColInfoVO : dbTableConfAndInfoVO.getDbTableColInfoVOSet()) {
      if (isFirst) {
        isFirst = false;
      } else {
        sql.append(", ");
      }
      sql.append("t.").append(dbTableColInfoVO.getColName());
    }
    sql.append(" FROM ").append(dbTableConfAndInfoVO.getDbTableInfoVO().getDbTableName()).append(" t");
    return sql.toString();
  }

  /**
   * 获取配置map
   */
  public static LinkedHashMap<String, String> getConfMap(String codeCi) throws Exception {
    if (CoreTool.isNullStr(codeCi)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    LinkedHashMap<String, String> rConfMap = new LinkedHashMap<>();
    if ("ci_2_space".equals(codeCi)) {
      rConfMap.put("ci", "  ");
    } else if ("ci_4_space".equals(codeCi)) {
      rConfMap.put("ci", "    ");
    } else if ("ci_tab".equals(codeCi)) {
      rConfMap.put("ci", "\t");
    }
    return rConfMap;
  }

  /**
   * 以中线分割项目模块名
   */
  public static LinkedHashSet<String> getProjectModuleNameSet(String projectModuleName) throws Exception {
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    LinkedHashSet<String> rProjectsModulesNameSet = new LinkedHashSet<>();
    for (String s : projectModuleName.split("-")) {
      rProjectsModulesNameSet.add(s);
    }
    return rProjectsModulesNameSet;
  }

  /**
   * 获取java数据类型
   */
  public static String getJavaDataType(String dataType) throws Exception {
    if (CoreTool.isNullStr(dataType)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (dataType.indexOf("varchar") != -1) {
      return "String";
    } else if (dataType.indexOf("bigint") != -1) {
      return "Long";
    } else if (dataType.indexOf("VARCHAR") != -1) {
      return "String";
    } else if (dataType.indexOf("NUMBER") != -1) {
      return "Long";
    } else if (dataType.indexOf("text") != -1) {
      return "String";
    } else if (dataType.indexOf("integer") != -1) {
      return "Long";
    } else if (dataType.indexOf("int") != -1) {
      return "Long";
    } else if (dataType.indexOf("char") != -1) {
      return "String";
    } else {
      return "String";
    }
  }

  /**
   * 获取ts数据类型
   */
  public static String getTsDataType(String dataType) throws Exception {
    if (CoreTool.isNullStr(dataType)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (dataType.indexOf("varchar") != -1) {
      return "string";
    } else if (dataType.indexOf("bigint") != -1) {
      return "number";
    } else if (dataType.indexOf("VARCHAR") != -1) {
      return "string";
    } else if (dataType.indexOf("NUMBER") != -1) {
      return "number";
    } else if (dataType.indexOf("text") != -1) {
      return "string";
    } else if (dataType.indexOf("integer") != -1) {
      return "number";
    } else if (dataType.indexOf("int") != -1) {
      return "number";
    } else if (dataType.indexOf("char") != -1) {
      return "string";
    } else {
      return "string";
    }
  }

  /**
   * 判断字段是否为空
   */
  public static String getIsNull(String s) throws Exception {
    if (CoreTool.isNullStr(s)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if ("NO".equals(s)) {
      return "n";
    } else if ("YES".equals(s)) {
      return "y";
    } else if ("N".equals(s)) {
      return "n";
    }  else if ("Y".equals(s)) {
      return "y";
    } else {
      return "y";
    }
  }

  /**
   * 获取项目模块pom文件路径
   */
  public static String getProjectModulePomFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator).append(pomxml);
    return rs.toString();
  }

  /**
   * 获取项目模块gitignore文件路径
   */
  public static String getProjectModuleGitignoreFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator).append(gitignore);
    return rs.toString();
  }

  /**
   * 获取代码文件README文件路径
   */
  public static String getCodeFileReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(readme);
    return rs.toString();
  }

  /**
   * 获取资源文件README文件路径
   */
  public static String getResourcesFileReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : resourcesFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(readme);
    return rs.toString();
  }

  /**
   * 获取java jdbc实体类README文件路径
   */
  public static String getJavaJdbcEntityReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(entity).append(File.separator).append(readme);
    return rs.toString();
  }

  /**
   * 获取mapper持久化接口类README文件路径
   */
  public static String getMapperReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(mapper).append(File.separator).append(readme);
    return rs.toString();
  }

  /**
   * 获取参数类README文件路径
   */
  public static String getParamReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(param).append(File.separator).append(readme);
    return rs.toString();
  }

  /**
   * 获取业务类README文件路径
   */
  public static String getBussReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(bo).append(File.separator).append(readme);
    return rs.toString();
  }

  /**
   * 获取查询类README文件路径
   */
  public static String getQueryReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(qo).append(File.separator).append(readme);
    return rs.toString();
  }

  /**
   * 获取rest接口类README文件路径
   */
  public static String getRestReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(rest).append(File.separator).append(readme);
    return rs.toString();
  }

  /**
   * 获取服务接口类README文件路径
   */
  public static String getServiceInterfacesReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(service).append(File.separator);
    rs.append(interfaces).append(File.separator);
    rs.append(readme);
    return rs.toString();
  }

  /**
   * 获取服务实现类README文件路径
   */
  public static String getServiceImplementReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(service).append(File.separator);
    rs.append(implement).append(File.separator);
    rs.append(readme);
    return rs.toString();
  }

  /**
   * 获取展示类README文件路径
   */
  public static String getVoReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(vo).append(File.separator).append(readme);
    return rs.toString();
  }

  /**
   * 获取mapper sql文件README文件路径
   */
  public static String getMappingReadmeFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : resourcesFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(mapping).append(File.separator).append(readme);
    return rs.toString();
  }

  /**
   * 获取jdbc实体类包名
   */
  public static String getJdbcEntityPackageName(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    for (String s : packageNameSet) {
      rs.append(s).append(packageSplit);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(packageSplit);
    }
    rs.append(entity);
    return rs.toString();
  }

  /**
   * 获取jdbc实体类文件路径
   */
  public static String getJdbcEntityFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(entity).append(File.separator);
    rs.append(initialCaseEntityName).append(javaFileSuffix);
    return rs.toString();
  }

  /**
   * 获取查询类包名
   */
  public static String getQueryPackageName(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    for (String s : packageNameSet) {
      rs.append(s).append(packageSplit);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(packageSplit);
    }
    rs.append(qo);
    return rs.toString();
  }

  /**
   * 获取查询类文件路径
   */
  public static String getQueryFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(qo).append(File.separator);
    rs.append(initialCaseEntityName).append(QO).append(javaFileSuffix);
    return rs.toString();
  }

  /**
   * 获取展示类包名
   */
  public static String getVoPackageName(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    for (String s : packageNameSet) {
      rs.append(s).append(packageSplit);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(packageSplit);
    }
    rs.append(vo);
    return rs.toString();
  }

  /**
   * 获取展示类文件路径
   */
  public static String getVoFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(vo).append(File.separator);
    rs.append(initialCaseEntityName).append(VO).append(javaFileSuffix);
    return rs.toString();
  }

  /**
   * 获取mapper持久化接口类包名
   */
  public static String getMapperPersistentInterfacesPackageName(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    for (String s : packageNameSet) {
      rs.append(s).append(packageSplit);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(packageSplit);
    }
    rs.append(mapper);
    return rs.toString();
  }

  /**
   * 获取mapper持久化接口类文件路径
   */
  public static String getMapperPersistentInterfacesFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(mapper).append(File.separator);
    rs.append(initialCaseEntityName).append(Mapper).append(javaFileSuffix);
    return rs.toString();
  }

  /**
   * 获取mapper sql文件路径
   */
  public static String getMapperSqlFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : resourcesFilePathNameSet ) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(mapping).append(File.separator);
    rs.append(initialCaseEntityName).append(Mapper).append(xmlFileSuffix);
    return rs.toString();
  }

  /**
   * 获取服务接口类包名
   */
  public static String getServiceInterfacesPackageName(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    for (String s : packageNameSet) {
      rs.append(s).append(packageSplit);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(packageSplit);
    }
    rs.append(service).append(packageSplit);
    rs.append(interfaces);
    return rs.toString();
  }

  /**
   * 获取服务接口类文件路径
   */
  public static String getServiceInterfacesFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(service).append(File.separator);
    rs.append(interfaces).append(File.separator);
    rs.append(I).append(initialCaseEntityName).append(Service).append(javaFileSuffix);
    return rs.toString();
  }

  /**
   * 获取服务实现类包名
   */
  public static String getServiceImplementPackageName(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    for (String s : packageNameSet) {
      rs.append(s).append(packageSplit);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(packageSplit);
    }
    rs.append(service).append(packageSplit);
    rs.append(implement);
    return rs.toString();
  }

  /**
   * 获取服务实现类文件路径
   */
  public static String getServiceImplementFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(service).append(File.separator);
    rs.append(implement).append(File.separator);
    rs.append(initialCaseEntityName).append(ServiceImpl).append(javaFileSuffix);
    return rs.toString();
  }

  /**
   * 获取rest接口类包名
   */
  public static String getRestPackageName(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    for (String s : packageNameSet) {
      rs.append(s).append(packageSplit);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(packageSplit);
    }
    rs.append(rest);
    return rs.toString();
  }

  /**
   * 获取rest接口类文件路径
   */
  public static String getRestFilePath(String projectPath, String projectModuleName, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPath)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPath.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isNullStr(projectModuleName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPath);
    if (!File.separator.equals(projectPath.substring(projectPath.length() - 1, projectPath.length()))) {
      rs.append(File.separator);
    }
    rs.append(projectModuleName).append(File.separator);
    for (String s : codeFilePathNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(rest).append(File.separator);
    rs.append(initialCaseEntityName).append(Controller).append(javaFileSuffix);
    return rs.toString();
  }

  /**
   * 获取rest url命名前缀
   */
  public static String getRestUrlNamePrefix(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    for (String s : projectModuleNameSet) {
      rs.append(s).append("/");
    }
    return rs.toString();
  }

  /**
   * 获取vue实体类文件路径
   */
  public static String getVueEntityFilePath(String projectPathVue, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPathVue)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPathVue.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPathVue);
    if (!File.separator.equals(projectPathVue.substring(projectPathVue.length() - 1, projectPathVue.length()))) {
      rs.append(File.separator);
    }
    rs.append(src).append(File.separator);
    rs.append(model).append(File.separator);
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(entity).append(File.separator);
    rs.append(initialCaseEntityName).append(tsFileSuffix);
    return rs.toString();
  }

  /**
   * 获取vue查询类文件路径
   */
  public static String getVueQueryFilePath(String projectPathVue, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPathVue)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPathVue.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPathVue);
    if (!File.separator.equals(projectPathVue.substring(projectPathVue.length() - 1, projectPathVue.length()))) {
      rs.append(File.separator);
    }
    rs.append(src).append(File.separator);
    rs.append(model).append(File.separator);
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(qo).append(File.separator);
    rs.append(initialCaseEntityName).append(QO).append(tsFileSuffix);
    return rs.toString();
  }

  /**
   * 获取vue展示类文件路径
   */
  public static String getVueVoFilePath(String projectPathVue, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPathVue)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPathVue.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPathVue);
    if (!File.separator.equals(projectPathVue.substring(projectPathVue.length() - 1, projectPathVue.length()))) {
      rs.append(File.separator);
    }
    rs.append(src).append(File.separator);
    rs.append(model).append(File.separator);
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(vo).append(File.separator);
    rs.append(initialCaseEntityName).append(VO).append(tsFileSuffix);
    return rs.toString();
  }

  /**
   * 获取vue api服务类文件路径
   */
  public static String getVueApiServiceFilePath(String projectPathVue, LinkedHashSet<String> projectModuleNameSet, String initialLowercaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPathVue)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPathVue.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialLowercaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPathVue);
    if (!File.separator.equals(projectPathVue.substring(projectPathVue.length() - 1, projectPathVue.length()))) {
      rs.append(File.separator);
    }
    rs.append(src).append(File.separator);
    rs.append(api).append(File.separator);
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(initialLowercaseEntityName).append(Service).append(tsFileSuffix);
    return rs.toString();
  }

  /**
   * 获取vue store文件路径
   */
  public static String getVueStoreFilePath(String projectPathVue, LinkedHashSet<String> projectModuleNameSet, String initialLowercaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPathVue)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPathVue.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialLowercaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPathVue);
    if (!File.separator.equals(projectPathVue.substring(projectPathVue.length() - 1, projectPathVue.length()))) {
      rs.append(File.separator);
    }
    rs.append(src).append(File.separator);
    rs.append(store).append(File.separator);
    rs.append(modules).append(File.separator);
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(initialLowercaseEntityName).append(Store).append(tsFileSuffix);
    return rs.toString();
  }

  /**
   * 获取vue页面文件路径
   */
  public static String getVueViewFilePath(String projectPathVue, LinkedHashSet<String> projectModuleNameSet, String initialCaseEntityName) throws Exception {
    if (CoreTool.isNullStr(projectPathVue)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (projectPathVue.indexOf(File.separator) == -1) {
      throw new CoreException("项目路径参数配置有误！请检查配置信息！");
    }
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    if (CoreTool.isNullStr(initialCaseEntityName)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(projectPathVue);
    if (!File.separator.equals(projectPathVue.substring(projectPathVue.length() - 1, projectPathVue.length()))) {
      rs.append(File.separator);
    }
    rs.append(src).append(File.separator);
    rs.append(views).append(File.separator);
    for (String s : packageNameSet) {
      rs.append(s).append(File.separator);
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append(File.separator);
    }
    rs.append(initialCaseEntityName).append(vueFileSuffix);
    return rs.toString();
  }

  /**
   * 获取vue实体类文件引用路径
   */
  public static String getVueEntityFileQuotePath(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(model).append("/");
    for (String s : packageNameSet) {
      rs.append(s).append("/");
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append("/");
    }
    rs.append(entity).append("/");
    return rs.toString();
  }

  /**
   * 获取vue查询类文件引用路径
   */
  public static String getVueQueryFileQuotePath(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(model).append("/");
    for (String s : packageNameSet) {
      rs.append(s).append("/");
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append("/");
    }
    rs.append(qo).append("/");
    return rs.toString();
  }

  /**
   * 获取vue展示类文件引用路径
   */
  public static String getVueVoFileQuotePath(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(model).append("/");
    for (String s : packageNameSet) {
      rs.append(s).append("/");
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append("/");
    }
    rs.append(vo).append("/");
    return rs.toString();
  }

  /**
   * 获取vue api服务类文件引用路径
   */
  public static String getVueApiServiceFileQuotePath(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(api).append("/");
    for (String s : packageNameSet) {
      rs.append(s).append("/");
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append("/");
    }
    return rs.toString();
  }

  /**
   * 获取vue store文件引用路径
   */
  public static String getVueStoreFileQuotePath(LinkedHashSet<String> projectModuleNameSet) throws Exception {
    if (CoreTool.isEmpty(projectModuleNameSet)) {
      throw new CoreException(CoreException.E_PARAM_ERR);
    }
    StringBuilder rs = new StringBuilder();
    rs.append(store).append("/").append(modules).append("/");
    for (String s : packageNameSet) {
      rs.append(s).append("/");
    }
    for (String s : projectModuleNameSet) {
      rs.append(s).append("/");
    }
    return rs.toString();
  }

}
